//
//  RCDPadTextField.m
//  jsy
//
//  Created by  任辰东 on 2020/4/11.
//  Copyright © 2020 JSY. All rights reserved.
//

#import "RCDPadTextField.h"

@implementation RCDPadTextField

- (CGRect)editingRectForBounds:(CGRect)bounds
{
    CGRect rect = CGRectMake(CGRectGetMaxX(self.leftView.frame) + 16, bounds.origin.y, bounds.size.width - 3*16, bounds.size.height);
    return rect;
}

- (CGRect)placeholderRectForBounds:(CGRect)bounds
{
    CGRect rect = CGRectMake(CGRectGetMaxX(self.leftView.frame) + 16, bounds.origin.y, bounds.size.width - 3*16, bounds.size.height);
    return rect;
}

- (CGRect)textRectForBounds:(CGRect)bounds
{
    CGRect rect = CGRectMake(CGRectGetMaxX(self.leftView.frame) + 16, bounds.origin.y, bounds.size.width - 3*16, bounds.size.height);
    return rect;
}

//- (CGRect)leftViewRectForBounds:(CGRect)bounds
//{
//    CGRect iconRect = [super leftViewRectForBounds:bounds];
//    iconRect.origin.x += 15; //像右边偏15
//    return iconRect;
//}

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = UIColorFromHex(0xffffff);
        self.clearButtonMode = UITextFieldViewModeWhileEditing;
    }
    return self;
}


@end
